package com.moonshine.utils;

import java.io.File;
import java.io.FileFilter;
import java.util.List;

public class FileUtils {

	public static void findFilesRecursive(List<File> out, String[] filePaths) {
		
	}

	public static void findFilesRecursive(List<File> out, File current) {

		findFilesRecursive(out, current, null);
	}

	public static void findFilesRecursive(List<File> out, File current,
			FileFilter filter) {
		if (current.isDirectory()) {
			File[] files = current.listFiles();
			for (File file : files) {
				if (file.isDirectory()) {
					findFilesRecursive(out, file, filter);
				} else {
					if (filter != null && filter.accept(file)) {
						out.add(file);
					}
				}
			}

		} else {
			if (filter != null && filter.accept(current)) {
				out.add(current);
			} else {
				out.add(current);
			}
		}
	}
}
